package com.example.kingdeescan.ui.recored;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.MediatorLiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import com.example.kingdeescan.dao.FBiller;
import com.example.kingdeescan.dao.FDept;
import com.example.kingdeescan.dao.FEmp;
import com.example.kingdeescan.dao.FFManger;
import com.example.kingdeescan.dao.FOrg;
import com.example.kingdeescan.dao.SEOutStock;

import java.util.List;

public class RecoredViewModel extends ViewModel {

    private MutableLiveData<Integer> searchType;//搜索类型
    private MutableLiveData<String> fSupplyText;//供应商文本
    private MutableLiveData<String> fSelBillNoText;//选单号文本
    private MutableLiveData<String> fDeptText;//部门文本
    private MutableLiveData<String> fEmpText;//业务员文本
    private MutableLiveData<String> fFManagerText;//发货员文本
    private MutableLiveData<String> fBillerText;//制单员文本

    private MutableLiveData<FOrg> fOrgMLD;
    private MutableLiveData<FDept> fDeptMLD;
    private MutableLiveData<FEmp> fEmpMLD;
    private MutableLiveData<FFManger> ffMangerMLD;
    private MutableLiveData<FBiller> fBillerMLD;
    private MutableLiveData<List<SEOutStock>> seOutStockListMLD;

    public LiveData<FOrg> getfOrgMLD() {
        return this.fOrgMLD;
    }
    public void setfOrgMLD(FOrg fOrg) {
        this.fOrgMLD.setValue(fOrg);
    }

    public LiveData<FDept> getfDeptMLD() {
        return this.fDeptMLD;
    }
    public void setfDeptMLD(FDept fDept) {
        this.fDeptMLD.setValue(fDept);
    }

    public LiveData<FEmp> getfEmpMLD() {
        return this.fEmpMLD;
    }
    public void setfEmpMLD(FEmp fEmp) {
        this.fEmpMLD.setValue(fEmp);
    }

    public LiveData<FFManger> getFfMangerMLD() {
        return this.ffMangerMLD;
    }
    public void setFfMangerMLD(FFManger ffManger) {
        this.ffMangerMLD.setValue(ffManger);
    }

    public LiveData<FBiller> getFBillerMLD() {
        return this.fBillerMLD;
    }
    public void setFBillerMLD(FBiller fBiller) {
        this.fBillerMLD.setValue(fBiller);
    }

    public LiveData<List<SEOutStock>> getSeOutStockListMLD() {
        return this.seOutStockListMLD;
    }
    public void setSeOutStockListMLD(List<SEOutStock> seOutStockList) {
        this.seOutStockListMLD.setValue(seOutStockList);
    }

    public LiveData<String> getfSupplyText() {
        if (null==fSupplyText){
            fSupplyText=new MutableLiveData<>();
        }
        return fSupplyText;
    }
    public void setfSupplyText(String newText) {
        this.fSupplyText.setValue(newText);
    }

    public LiveData<String> getfSelBillNoText() {
        if (null==fSelBillNoText){
            fSelBillNoText=new MutableLiveData<>();
        }
        return fSelBillNoText;
    }
    public void setfSelBillNoText(String newText) {
        this.fSelBillNoText.setValue(newText);
    }

    public LiveData<String> getfDeptText() {
        if (null==fDeptText){
            fDeptText=new MutableLiveData<>();
        }
        return fDeptText;
    }
    public void setfDeptText(String newText) {
        this.fDeptText.setValue(newText);
    }

    public LiveData<String> getfEmpText() {
        if (null==fEmpText){
            fEmpText=new MutableLiveData<>();
        }
        return fEmpText;
    }
    public void setfEmpText(String newText) {
        this.fEmpText.setValue(newText);
    }

    public LiveData<String> getfFManagerText() {
        if (null==fFManagerText){
            fFManagerText=new MutableLiveData<>();
        }
        return fFManagerText;
    }
    public void setfFManagerText(String newText) {
        this.fFManagerText.setValue(newText);
    }

    public LiveData<String> getfBillerText() {
        if (null==fBillerText){
            fBillerText=new MutableLiveData<>();
        }
        return fBillerText;
    }
    public void setfBillerText(String newText) {
        this.fBillerText.setValue(newText);
    }

    public void setSearchType(Integer s){
        searchType.setValue(s);
    }
    public LiveData<Integer> getSearchType() {
        if (null==searchType){
            searchType=new MutableLiveData<>();
        }
        return searchType;
    }

    public RecoredViewModel() {
        this.searchType = new MutableLiveData<>();
        this.fSupplyText = new MutableLiveData<>();
        this.fSelBillNoText = new MutableLiveData<>();
        this.fDeptText = new MutableLiveData<>();
        this.fEmpText = new MutableLiveData<>();
        this.fFManagerText = new MutableLiveData<>();
        this.fBillerText = new MutableLiveData<>();

        this.fDeptMLD=new MutableLiveData<>();
        this.fEmpMLD=new MutableLiveData<>();
        this.ffMangerMLD=new MutableLiveData<>();
        this.fOrgMLD=new MutableLiveData<>();
        this.fBillerMLD=new MutableLiveData<>();
        this.seOutStockListMLD=new MutableLiveData<>();
    }
}